

<%@ page import="org.gtesoreria.Afiliado" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'afiliado.label', default: 'Afiliado')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        
        <div class="body">
            <h1>Nuevo Afiliado</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${afiliadoInstance}">
            <div class="errors">
                <g:renderErrors bean="${afiliadoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                 <!-- Start Render the afiliado template (_afiliado.gsp) here -->
                <g:render template="afiliado" model="['afiliadoInstance':afiliadoInstance]"/>
                <!-- End Render the afiliado template (_afiliado.gsp) here -->
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Crear')}" /></span>
                </div>
            </g:form>
        </div>
         <!-- Start Render the familiar template (_familiar.gsp) hidden so we can clone it -->
        <g:render template='familiar' model="['familiar':null,'i':'_clone','hidden':true]"/>
    	<!-- End Render the familiar template (_familiar.gsp) hidden so we can clone it -->
    </body>
   <script type="text/javascript">
        showOrHideDelegados();
	// This is called when the page loads to initialize city 
		var zselect = document.getElementById('lugarTrabajo.id') 
		var zopt = zselect.options[zselect.selectedIndex] 
		${remoteFunction(controller:"dependencia", action:"ajaxGetDependencias", params:"'id=' + zopt.value", onComplete:"updateDependencia(e)")}

</script>

</html>
